<template>
	<el-main>
		<el-card shadow="never">
			<el-tabs tab-position="top">
				<el-tab-pane label="SingalR">
					<el-form
						ref="form"
						:model="sys"
						label-width="100px"
						style="margin-top: 20px"
					>
						<el-form-item label="消息">
							<el-input
								type="textarea"
								:autosize="{ minRows: 4 }"
								v-model="sys.message"
							></el-input>
						</el-form-item>
					</el-form>
				</el-tab-pane>
			</el-tabs>
			<div class="save-div">
				<el-button type="primary" @click="publish">发送</el-button>
			</div>

			<el-input
				type="textarea"
				:autosize="{ minRows: 4 }"
				v-model="result"
			></el-input>
		</el-card>
	</el-main>
</template>

<script>
export default {
	name: "system",
	data() {
		return {
			sys: {
				message: "",
			},
			result: "",
			chatGpts: [],
		};
	},
	mounted() {},
	methods: {
		async publish() {
			var message = this.sys.message;
			var response = await this.$API.userMessage.push.post({
				message: message,
			});
			if (response.code == 200) {
				this.result += message + ",发送成功\n";
				//this.result = this.result.replaceAll("//script", "/script");
			}
		},
	},
};
</script>

<style>
.save-div {
}
</style>
